package com.myboot.springbootmybatis.Test;

import com.myboot.springbootmybatis.pojo.Teacher;
import org.springframework.web.bind.annotation.*;

@RestController
public class zhujie {
    @GetMapping("/query/{stuId}")
    public Integer query(@PathVariable(value = "stuId") Integer studentId){
       return studentId;
    }
    @PostMapping("/insert/{name}/{age}")
    public String createStudent(@PathVariable(value = "name") String name,
                                @PathVariable(value = "age") Integer age){
        return name + age;
    }
    @PutMapping("/update/{name}/{age}")
    public String updateStudent(@PathVariable String name,
                                @PathVariable Integer age){
        return "姓名是"+name +"年龄是"+ age;
    }
    @DeleteMapping("/del/{id}")
    public String deleteStudent(@PathVariable Integer id) {
        return "删除的学生id是"+id;
    }

    @PutMapping("/myupdate")
    public String updateStudent1(){
        return "PUT请求";
    }


}
